<!DOCTYPE html>
<html lang="en">
<head th:insert="/admin/common/head::css"></head>
<body>
<div th:insert="/admin/common/header::header" ></div>
<!--  main  -->
<div class="container-fluid">
  <div class="row-fluid">
    <div th:insert="/admin/common/side::side" ></div>
    <!-- content -->
    <div style="display: flex; flex-direction: column">
      <div class="span10" id="content">
        <div class="row-fluid">
          <!-- block -->
          <div class="block">
            <div class="navbar navbar-inner block-header" style="display: flex;flex-direction: column">
              <!--                            <a th:if="${loginUser.userType == 0}" style="margin-right: 10px;width: 18%;height: 30%" class="btn btn-default" th:href="@{/admin/app/add.html}" role="button">增加活动</a>-->
              <form method="post" th:action="@{/admin/app/page}">
                <input type="text" name="name" value="" placeholder="活动名称"/>
                <input type="text" name="username" placeholder="报名用户"/>
                <button style="margin-bottom: 18px" type="submit" class="btn btn-primary"  >搜索</button>
              </form>
            </div>
            <div class="block-content collapse in">
              <div class="span12">
                <table class="table">
                  <thead>
                  <tr>
                    <th>序号</th>
                    <th>活动名称</th>
                    <th>活动时间</th>
                    <th>地点</th>
                    <th>内容</th>
                    <th>发布人</th>
                    <th>活动类型</th>
                    <th>报名人</th>
                    <th>操作</th>
                  </tr>
                  </thead>
                  <tbody>
                  <tr th:each = "app : ${page.records}">
                    <td th:text="${app.id}"></td>
                    <td th:text="${app.active.name}"></td>
                    <td th:text="${#dates.format(app.active.time, 'yyyy/MM/dd')}"></td>
                    <td th:text="${app.active.address}"></td>
                    <td th:text="${app.active.content}"></td>
                    <td th:text="${app.active.user.username}"></td>
                    <td th:text="${app.active.type.name}"></td>
                    <td th:text="${app.user.username}"></td>
                    <td>
                      <!--            //这样可以拿到对应数据-->
                      <a class="btn btn-default" th:href="@{/admin/active/my/detail(id = ${app.id})}" role="button">  查看详情 </a>
                      <!--                                            <a class="btn btn-default" th:href="@{/admin/active/delete(id = ${active.id})}" role="button">删除</a>-->
                    </td>
                  </tr>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
          <!-- /block -->
        </div>
      </div>
      <div th:insert = "/admin/common/page::page"></div>
    </div>
    <!-- content -->
  </div>
</div>
<!--  main  -->
</body>
<div th:insert="/admin/common/footer::js" ></div>
<script type="text/javascript">

  document.getElementById("myactive").className = 'active'
</script>
</html>